﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Corsat.Library.DataManager;

namespace Corsat.Web._2013
{
    public partial class DefaultPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void BtnSearch_Clicked(object sender, EventArgs e)
        {
            var account = Main.GetAccountBySSN(txtAccountSSN.Text);
            if (account != null && account.AccountId > 0)
            {

                Session["accountId"] = account.AccountId;
                Session["CorsatId"] = account.CorsatId;
                Response.Redirect("Profile.aspx");
            }
            else
            {
                lblError.Visible = true;
            }
        }
    }
}